package com.dsj.util;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 *  数据库连接类
 */
public class DBConnection {
    private String dbDbriver = "com.mysql.cj.jdbc.Driver";
    private String url = "jdbc:mysql://localhost:3306/e24?useSSL=false&useUnicode=true&characterEncodeing=UTF-8&serverTimezone=GMT%2B8";
    public Connection connetction = null;
    public DBConnection() {
        try {
            Class.forName("com.mysql.cj.jdbc.Driver").newInstance();
            connetction = DriverManager.getConnection(url, "root", "123456");
        } catch (Exception e) {
            System.out.println("数据库加载失败，请联系管理员");
        }
    }
}
